<!--
  @author mujunlin
  @since 2019/08/15 10:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:replace="common/common :: jscss"/>
</head>
<body>
<div class="layui-fluid">

    <blockquote class="layui-crumb">
        <a th:lay-href="|/msg/temp/listByGroupId.action?groupId=${obj.groupId}|">模板管理</a>&nbsp;&nbsp;/&nbsp;
        <zmn th:text="${(obj.templateId == null||obj.templateId == 0) ? '新增模板':obj.name}">新增或修改模板</zmn>
    </blockquote>

    <div class="layui-card">
        <div th:replace="message/_tab::tab"></div>
        <div class="layui-card-body">
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">
                <!--用于保存或传值的隐藏表单元素
                   置于form标签内的最上方
                   -->
                <input type="hidden" th:value="${obj.templateId}" name="templateId"/>
                <input type="hidden" th:value="${obj.groupId}" name="groupId"/>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">模板名称：</label>
                    <div class="layui-input-inline" style="width:590px">
                        <input type="text" name="name" placeholder="不超过20个字符" lay-verify="required"
                               lay-verType="tips" th:value="${obj.name}"
                               autocomplete="off" class="layui-input" maxlength="20" th:disabled="${obj.status == 1}"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">类型：</label>
                    <div class="layui-input-inline" style="width:590px">
                        <input th:each="type:${types}" type="radio" name="templateType"
                               th:value="${type.key}" th:checked="${type.key == obj.templateType}"
                               th:title="${type.value}" lay-verify="templateType" th:disabled="${obj.status == 1}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注：</label>
                    <div class="layui-input-inline" style="width:590px">
                        <textarea name="remark" th:text="${obj.remark}" class="layui-textarea" placeholder="填写备注" lay-verify="" lay-verType="tips" maxlength="255" th:disabled="${obj.status == 1}"></textarea>
                    </div>
                </div>
                <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label layui-form-required">排序：</label>-->
                    <!--<div class="layui-input-inline" style="width: 390px">-->
                        <!--<input type="number" th:value="${obj.sort}" name="sort" autocomplete="off" class="layui-input"-->
                               <!--lay-verify="isPositiveNumber|required|minSort"  maxlength="8" onkeyup="if(this.value.length>7) this.value=this.value.slice(0,8);value=value.replace(/^(0+)|[^\d]+/g,'')" th:disabled="${obj.status == 1}">-->
                    <!--</div>-->
                <!--</div>-->

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button lay-submit="" lay-filter="zmn-form-submit" class="layui-btn"
                                th:if="${#authPermit.checkPermit('/msg/temp/addEdit.action')}">提交
                        </button>
                        <button type="button" class="layui-btn-primary layui-btn cancleBtn" onclick="zmnLayUtil.closeThisTabs()">取消</button>
                    </div>
                </div>
            </form>
        </div>


    </div>
</div>
<script type="text/javascript" th:inline="javascript">

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        msg_template_edit: "message/zmn.msg.template.edit",
    }).use(['index', 'msg_template_edit']);

</script>
</body>
</html>